s = 'hello,Python'

print('判断是否为合法字符串'.center(50,'*'))
print('合法字符串 hello,Python',s.isidentifier())
print('合法字符串 hhell','hhell'.isidentifier())
print('合法字符串 hej123','hej123'.isidentifier())

print('判断字符串是否全部由空白字符组成（回车、换行、制表符）'.center(50,'*'))
print('空白字符','\n'.isspace())

print('判断字符串是否全部由字母组成'.center(50,'*'))

print('字母absw','absw'.isalpha()) #True
print('字母absw12','absw12'.isalpha()) #False
print('字母absw一','absw一'.isalpha()) #False
print('字母absw_','absw_'.isalpha()) #False


print('判断字符串是否全部为十进制数字组成'.center(50,'*'))
print('十进制数字 123','123'.isdecimal())
print('十进制数字 123Ⅲ ','123Ⅲ'.isdecimal())


print('判断字符串是否由全部由数字组成'.center(50,'*'))
print('数字 123','123'.isnumeric())
print('数字 123a','123a'.isnumeric())
print('数字 123Ⅲ ','123Ⅲ'.isnumeric())

print('判断字符串是否全部由字母和数字组成'.center(50,'*'))
print('字母和数字 asda123','asda123'.isalnum())
print('字母和数字 asda123Ⅲ','asda123Ⅲ'.isalnum())



print('字母和数字 12121','12121'.isdigit())

